package com.iampzh.springvue.comm;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class MyResult {
    private String code;
    private String msg;
    private Object data;
    public final static  MyResult success(Object data){
return new MyResult(ResultCode.CODE_200,"成功",data);
    }
    public final static  MyResult success(){
        return new MyResult(ResultCode.CODE_200,"成功",null);
    }
    public final static  MyResult error401(){
        return new MyResult(ResultCode.CODE_401,"权限不足",null);
    }
    public final static  MyResult error400(){
        return new MyResult(ResultCode.CODE_400,"参数错误",null);
    }
    public final static  MyResult error500(){
        return new MyResult(ResultCode.CODE_500,"服务器错误",null);
    }
}
